package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.dao.DishFlavorDao;
import com.example.domain.DishFlavor;
import com.example.service.DishFlavorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

@Service
public class DishFlavorServiceImpl extends ServiceImpl<DishFlavorDao, DishFlavor> implements DishFlavorService {
    @Autowired DishFlavorDao dishFlavorDao;

    @Override
    public void savefalvor(DishFlavor dishFlavor) {
        dishFlavorDao.save(dishFlavor);
    }

    @Override
    public List<DishFlavor> seelctbydishid(Long dishId) {
        return dishFlavorDao.selectbydishid(dishId);
    }

    @Override
    public void update(DishFlavor dishFlavor) {
        dishFlavorDao.update(dishFlavor);
    }

    @Override
    public List<String> getnamebydishid(Long dishId) {
        return dishFlavorDao.getnamebydishid(dishId);
    }

    @Override
    public void deletebynameanddishid(String name, Long dishId) {
        dishFlavorDao.deletebynameanddishid(name,dishId);
    }
}
